package org.zachary.creditbusiness.hotel.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;
import org.zachary.commonmodule.entity.MqTransmissionJson;


@Service
public class KafkaProducerService {
    @Autowired
    private KafkaTemplate<String, MqTransmissionJson> transmissionKafkaTemplate;

    public void sendJsonMessage(String topic, MqTransmissionJson jsonEntity) {
        System.out.println(jsonEntity);
        transmissionKafkaTemplate.send(topic, jsonEntity);
    }
}